﻿// ----------------------------------------------------------------
// Description : 实体类,该文件由MyGeneration生成
// Author      : 
// Create date : 2009-12-13
// ----------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;

namespace ITOMMS.Entity
{
	/// <summary>
	///	VwProduct Entity
	///	VwProduct Entity
	/// </summary>
	[Serializable]
	public class VwProductEntity : BaseEntity<VwProductEntity,int>
	{
		
		#region 私有成员			
		
		private int _ID; 
		private string _产品名称; 
		private string _编号; 
		private int? _供应商; 
		private string _公司名称; 
		private string _品牌; 
		private string _类别; 
		private string _型号; 
		private string _单位; 
		private string _规格; 
		private string _采购价; 
		private string _批发价; 
		private string _零售价; 
		private int? _最低警戒线; 
		private int? _最高警戒线; 
		private string _备注; 
		private bool? _是否包含税; 
		private int? _数量; 
		private DateTime? _CreateDate; 
		private int? _CreateBy; 
		private DateTime? _ModifyDate; 
		private int? _ModifyBy; 
		private int _SEQNO;
		#endregion


		
		#region 默认( 空 ) 构造函数
		/// <summary>
		/// 默认构造函数
		/// </summary>
		public VwProductEntity()
		{
			_ID = 0; 
			_产品名称 = String.Empty; 
			_编号 = String.Empty; 
			_供应商 =  null; 
			_公司名称 = String.Empty; 
			_品牌 = String.Empty; 
			_类别 = String.Empty; 
			_型号 = String.Empty; 
			_单位 = String.Empty; 
			_规格 = String.Empty; 
			_采购价 = String.Empty; 
			_批发价 = String.Empty; 
			_零售价 = String.Empty; 
			_最低警戒线 =  null; 
			_最高警戒线 =  null; 
			_备注 = String.Empty; 
			_是否包含税 =  null; 
			_数量 =  null; 
			_CreateDate =  null; 
			_CreateBy =  null; 
			_ModifyDate =  null; 
			_ModifyBy =  null; 
			_SEQNO = 0;
		}
		#endregion
		
		#region 属性值校验
		
		/// <summary>
		/// 属性值校验
		/// </summary>
		public bool CheckValues()
		{
			bool bResult = true;
			string strError = "";
		
			if ( _ID ==  0)
			{
				bResult = false;
				strError += "\r\n 非空值不能为: "+_ID;
			}
			
			if( !bResult )
					throw new ArgumentOutOfRangeException(strError);
			return bResult;
			
		}
		
		#endregion
		
		
		
	
		#region Required Fields Only Constructor
		
		/// <summary>
		/// required (not null) fields only constructor
		/// </summary>
		public VwProductEntity(
		int para_ID		)
		: this()
		{
					_ID = para_ID;
			_产品名称 = String.Empty;
			_编号 = String.Empty;
			_供应商 = null;
			_公司名称 = String.Empty;
			_品牌 = String.Empty;
			_类别 = String.Empty;
			_型号 = String.Empty;
			_单位 = String.Empty;
			_规格 = String.Empty;
			_采购价 = String.Empty;
			_批发价 = String.Empty;
			_零售价 = String.Empty;
			_最低警戒线 = null;
			_最高警戒线 = null;
			_备注 = String.Empty;
			_是否包含税 = null;
			_数量 = null;
			_CreateDate = null;
			_CreateBy = null;
			_ModifyDate = null;
			_ModifyBy = null;
		}
		#endregion 

		
		#region 公有属性
			
			/// <summary>
			/// 行号，顺序号。系统默认的属性,对这个属性不要作操作.属性值在架构中已经处理
			/// </summary>
			public virtual int SEQNO
			{
				get { return _SEQNO; }
				set { _SEQNO = value; }
			}
		
			
		/// <summary>
		/// ID
		/// </summary>		
		public virtual int ID
		{
			get { return _ID; }
			set { _ID = value; }
		}
			
		/// <summary>
		/// 产品名称
		/// </summary>		
		public virtual string 产品名称
		{
			get { return _产品名称; }
			set	
			{
				
				if ( value != null)
					if( value.Length > 50)
						throw new ArgumentOutOfRangeException("Invalid value for 产品名称", value, value.ToString());
				
				_产品名称 = value;
			}
		}
			
		/// <summary>
		/// 编号
		/// </summary>		
		public virtual string 编号
		{
			get { return _编号; }
			set	
			{
				
				if ( value != null)
					if( value.Length > 50)
						throw new ArgumentOutOfRangeException("Invalid value for 编号", value, value.ToString());
				
				_编号 = value;
			}
		}
			
		/// <summary>
		/// 供应商
		/// </summary>		
		public virtual int? 供应商
		{
			get { return _供应商; }
			set { _供应商 = value; }
		}
			
		/// <summary>
		/// 公司名称
		/// </summary>		
		public virtual string 公司名称
		{
			get { return _公司名称; }
			set	
			{
				
				if ( value != null)
					if( value.Length > 50)
						throw new ArgumentOutOfRangeException("Invalid value for 公司名称", value, value.ToString());
				
				_公司名称 = value;
			}
		}
			
		/// <summary>
		/// 品牌
		/// </summary>		
		public virtual string 品牌
		{
			get { return _品牌; }
			set	
			{
				
				if ( value != null)
					if( value.Length > 50)
						throw new ArgumentOutOfRangeException("Invalid value for 品牌", value, value.ToString());
				
				_品牌 = value;
			}
		}
			
		/// <summary>
		/// 类别
		/// </summary>		
		public virtual string 类别
		{
			get { return _类别; }
			set	
			{
				
				if ( value != null)
					if( value.Length > 50)
						throw new ArgumentOutOfRangeException("Invalid value for 类别", value, value.ToString());
				
				_类别 = value;
			}
		}
			
		/// <summary>
		/// 型号
		/// </summary>		
		public virtual string 型号
		{
			get { return _型号; }
			set	
			{
				
				if ( value != null)
					if( value.Length > 50)
						throw new ArgumentOutOfRangeException("Invalid value for 型号", value, value.ToString());
				
				_型号 = value;
			}
		}
			
		/// <summary>
		/// 单位
		/// </summary>		
		public virtual string 单位
		{
			get { return _单位; }
			set	
			{
				
				if ( value != null)
					if( value.Length > 50)
						throw new ArgumentOutOfRangeException("Invalid value for 单位", value, value.ToString());
				
				_单位 = value;
			}
		}
			
		/// <summary>
		/// 规格
		/// </summary>		
		public virtual string 规格
		{
			get { return _规格; }
			set	
			{
				
				if ( value != null)
					if( value.Length > 50)
						throw new ArgumentOutOfRangeException("Invalid value for 规格", value, value.ToString());
				
				_规格 = value;
			}
		}
			
		/// <summary>
		/// 采购价
		/// </summary>		
		public virtual string 采购价
		{
			get { return _采购价; }
			set	
			{
				
				if ( value != null)
					if( value.Length > 50)
						throw new ArgumentOutOfRangeException("Invalid value for 采购价", value, value.ToString());
				
				_采购价 = value;
			}
		}
			
		/// <summary>
		/// 批发价
		/// </summary>		
		public virtual string 批发价
		{
			get { return _批发价; }
			set	
			{
				
				if ( value != null)
					if( value.Length > 50)
						throw new ArgumentOutOfRangeException("Invalid value for 批发价", value, value.ToString());
				
				_批发价 = value;
			}
		}
			
		/// <summary>
		/// 零售价
		/// </summary>		
		public virtual string 零售价
		{
			get { return _零售价; }
			set	
			{
				
				if ( value != null)
					if( value.Length > 50)
						throw new ArgumentOutOfRangeException("Invalid value for 零售价", value, value.ToString());
				
				_零售价 = value;
			}
		}
			
		/// <summary>
		/// 最低警戒线
		/// </summary>		
		public virtual int? 最低警戒线
		{
			get { return _最低警戒线; }
			set { _最低警戒线 = value; }
		}
			
		/// <summary>
		/// 最高警戒线
		/// </summary>		
		public virtual int? 最高警戒线
		{
			get { return _最高警戒线; }
			set { _最高警戒线 = value; }
		}
			
		/// <summary>
		/// 备注
		/// </summary>		
		public virtual string 备注
		{
			get { return _备注; }
			set	
			{
				
				if ( value != null)
					if( value.Length > 500)
						throw new ArgumentOutOfRangeException("Invalid value for 备注", value, value.ToString());
				
				_备注 = value;
			}
		}
			
		/// <summary>
		/// 是否包含税
		/// </summary>		
		public virtual bool? 是否包含税
		{
			get { return _是否包含税; }
			set { _是否包含税 = value; }
		}
			
		/// <summary>
		/// 数量
		/// </summary>		
		public virtual int? 数量
		{
			get { return _数量; }
			set { _数量 = value; }
		}
			
		/// <summary>
		/// CreateDate
		/// </summary>		
		public virtual DateTime? CreateDate
		{
			get { return _CreateDate; }
			set { _CreateDate = value; }
		}
			
		/// <summary>
		/// CreateBy
		/// </summary>		
		public virtual int? CreateBy
		{
			get { return _CreateBy; }
			set { _CreateBy = value; }
		}
			
		/// <summary>
		/// ModifyDate
		/// </summary>		
		public virtual DateTime? ModifyDate
		{
			get { return _ModifyDate; }
			set { _ModifyDate = value; }
		}
			
		/// <summary>
		/// ModifyBy
		/// </summary>		
		public virtual int? ModifyBy
		{
			get { return _ModifyBy; }
			set { _ModifyBy = value; }
		}
			


		#endregion 	
		
		
        #region DAO操作
		
		
		/// <summary>
        /// 获取所有实体的列表
        /// </summary>
        /// <returns></returns>
        public override List<VwProductEntity> GetAll()
        {
            StringBuilder strSql = new StringBuilder();
			strSql.Append("select [ID],[产品名称],[编号],[供应商],[公司名称],[品牌],[类别],[型号],[单位],[规格],[采购价],[批发价],[零售价],[最低警戒线],[最高警戒线],[备注],[是否包含税],[数量],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy] from [Vw_Product] ");
	
            List<VwProductEntity> list = new List<VwProductEntity>();
            Database db = GetDatabase();
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            {
				int seq = 0;
                while (dataReader.Read())
                {	seq++;
                    list.Add(ReaderBind(dataReader,seq));
                }
            }
            return list;
        }
		
		/// <summary>
        /// 获取所有实体的列表总行数
        /// </summary>
        /// <returns></returns>
        public override int GetTotalRecords()
        {
            StringBuilder strSql = new StringBuilder();
			strSql.Append("  select count([ID])  from [Vw_Product] ");
	
            Database db = GetDatabase();
            return (int)db.ExecuteScalar(CommandType.Text, strSql.ToString());
        }
		
		/// <summary>
        /// 获取所有实体的列表总行数
        /// </summary>
        /// <returns></returns>
        public override int GetTotalRecords(string sqlCondition)
        {
            StringBuilder strSql = new StringBuilder();
			strSql.Append("  select count([ID])  from [Vw_Product]  ");
	
			 if (sqlCondition.Trim() != "")
            {
                strSql.Append(" where " + sqlCondition);
            }
            Database db = GetDatabase();
            return (int)db.ExecuteScalar(CommandType.Text, strSql.ToString());
        }	
		
		
		/// <summary>
        /// 按条件查询,得到一页的对应的结果列表
        /// </summary>
        /// <param name="strWhere">条件</param>
		/// <param name="PageSize">每页大小</param>
		/// <param name="CurrentPageIndex">当前页码</param>
        /// <returns></returns>
		 public override List<VwProductEntity> GetAllByQuery(string strWhere, int PageSize, int CurrentPageIndex)
        {
            StringBuilder strSql = new StringBuilder();
            if (strWhere.Contains("order".ToLower()))
            {
                throw new Exception("分页查询的sql条件中不能包括排序子句，请调用重载方法实现有条件的排序筛选");
            }
		 
			strSql.Append("select top ").Append(PageSize).Append("  [ID],[产品名称],[编号],[供应商],[公司名称],[品牌],[类别],[型号],[单位],[规格],[采购价],[批发价],[零售价],[最低警戒线],[最高警戒线],[备注],[是否包含税],[数量],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy] from [Vw_Product] where ");

			 if (strWhere.Trim() != "")
            {
                strSql.Append("  " + strWhere + " and ");
            }
			  strSql.Append(" ID not in ( ");
			 strSql.Append(" select top ").Append(PageSize*(CurrentPageIndex-1)).Append("  [ID] from [Vw_Product] ");

            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere );
            }
			strSql.Append(" ) " );

            List<VwProductEntity> list = new List<VwProductEntity>();
            Database db = GetDatabase();
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            {
			   int seq = PageSize * (CurrentPageIndex - 1);
                while (dataReader.Read())
                {
					seq++;
                    list.Add(ReaderBind(dataReader, seq));
                }
            }
            return list;
        }
		
		
			/// <summary>
        /// 按条件查询,得到一页的对应的结果列表
        /// </summary>
        /// <param name="strWhere">条件</param>
		/// <param name="PageSize">每页大小</param>
		/// <param name="CurrentPageIndex">当前页码</param>
		/// <param name="strSort">ex:order by id desc</param>
        /// <returns></returns>
		 public override List<VwProductEntity> GetAllByQuery(string strWhere,string strSort, int PageSize, int CurrentPageIndex)
        {
            StringBuilder strSql = new StringBuilder();
            if (strWhere.Contains("order".ToLower()))
            {
                throw new Exception("分页查询的sql条件中不能包括排序子句，请调用重载方法实现有条件的排序筛选");
            }
		 
			strSql.Append("select top ").Append(PageSize).Append("  [ID],[产品名称],[编号],[供应商],[公司名称],[品牌],[类别],[型号],[单位],[规格],[采购价],[批发价],[零售价],[最低警戒线],[最高警戒线],[备注],[是否包含税],[数量],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy] from [Vw_Product] where ");

			 if (strWhere.Trim() != "")
            {
                strSql.Append("  " + strWhere + " and ");
            }
			  strSql.Append(" ID not in ( ");
			 strSql.Append(" select top ").Append(PageSize*(CurrentPageIndex-1)).Append("  [ID] from [Vw_Product] ");

            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere+" " ).Append(strSort);
            }
			strSql.Append(" ) " ).Append(strSort);

            List<VwProductEntity> list = new List<VwProductEntity>();
            Database db = GetDatabase();
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            {
				int seq = PageSize * (CurrentPageIndex - 1);
                while (dataReader.Read())
                {	
					seq++;
                    list.Add(ReaderBind(dataReader, seq));
                }
            }
            return list;
        }
		
		
		/// <summary>
        /// 按条件查询,得到对应的结果列表
        /// </summary>
        /// <param name="strWhere"></param>
        /// <returns></returns>
        public override List<VwProductEntity> GetAllByQuery(string strWhere)
        {
			strWhere = SQLInjectionFilter(strWhere);
            StringBuilder strSql = new StringBuilder();
			strSql.Append("select [ID],[产品名称],[编号],[供应商],[公司名称],[品牌],[类别],[型号],[单位],[规格],[采购价],[批发价],[零售价],[最低警戒线],[最高警戒线],[备注],[是否包含税],[数量],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy] from Vw_Product ");

            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            List<VwProductEntity> list = new List<VwProductEntity>();
            Database db = GetDatabase();
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            { 
				int seq = 0;
                while (dataReader.Read())
                {
					seq++;
                    list.Add(ReaderBind(dataReader,seq));
                }
            }
            return list;
        }
		
		
		
		/// <summary>
        /// 按条件查询,得到对应的结果列表
        /// </summary>
        /// <param name="strWhere"></param>
		/// <param name="parameters">sql条件中的参数</param>
        /// <returns></returns>
        public override List<VwProductEntity> GetAllByQuery(string strWhere, List<IDataParameter> parameters)
        {
            StringBuilder strSql = new StringBuilder();
			strSql.Append("select [ID],[产品名称],[编号],[供应商],[公司名称],[品牌],[类别],[型号],[单位],[规格],[采购价],[批发价],[零售价],[最低警戒线],[最高警戒线],[备注],[是否包含税],[数量],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy] from [Vw_Product] ");

            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            List<VwProductEntity> list = new List<VwProductEntity>();
            Database db = GetDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            foreach (IDataParameter sp in parameters)
            {
                db.AddInParameter(dbCommand, sp.ParameterName, sp.DbType, sp.Value);
            }

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
				int seq =0 ;
                while (dataReader.Read())
                {
					seq++;
                    list.Add(ReaderBind(dataReader,seq));
                }
            }
            return list;
        }
		
		
		

		
		
		/// <summary>
        /// 获取按条件查询以后的结果列表的前指定rowNumber行记录
        /// </summary>
        /// <param name="strWhere">不带where关键字的SQL条件语句</param>
        /// <param name="rowNumber"></param>
        /// <returns></returns>
        public override List<VwProductEntity> GetAllByQuery(string strWhere, List<IDataParameter> parameters, int rowNumber)
        {

            StringBuilder strSql = new StringBuilder();
			strSql.Append("select top ").Append(rowNumber).Append("  [ID],[产品名称],[编号],[供应商],[公司名称],[品牌],[类别],[型号],[单位],[规格],[采购价],[批发价],[零售价],[最低警戒线],[最高警戒线],[备注],[是否包含税],[数量],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy] from [Vw_Product] ");

            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            List<VwProductEntity> list = new List<VwProductEntity>();
            Database db = GetDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            foreach (IDataParameter sp in parameters)
            {
                db.AddInParameter(dbCommand, sp.ParameterName, sp.DbType, sp.Value);
            }

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {	
				int seq = 0;
                while (dataReader.Read())
                {
					seq++;
                    list.Add(ReaderBind(dataReader,seq));
                }
            }
            return list;
        }
		
		
		/// <summary>
        /// 获取按条件查询以后的结果列表的前指定rowNumber行记录
        /// </summary>
        /// <param name="strWhere">不带where关键字的SQL条件语句: AND AA=@AA</param>
        /// <param name="rowNumber"></param>
        /// <returns></returns>
        public override List<VwProductEntity> GetAllByQuery(string strWhere, int rowNumber)
        {
		    strWhere = SQLInjectionFilter(strWhere);
            StringBuilder strSql = new StringBuilder();
			
			strSql.Append("select top ").Append(rowNumber).Append("  [ID],[产品名称],[编号],[供应商],[公司名称],[品牌],[类别],[型号],[单位],[规格],[采购价],[批发价],[零售价],[最低警戒线],[最高警戒线],[备注],[是否包含税],[数量],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy] from [Vw_Product] ");

            if (strWhere.Trim() != "")
            {
                strSql.Append(" where  " + strWhere);
            }
            List<VwProductEntity> list = new List<VwProductEntity>();
            Database db = GetDatabase();
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            {
				int seq=0;
                while (dataReader.Read())
                {	
					seq++;
                    list.Add(ReaderBind(dataReader,seq));
                }
            }
            return list;
        }
		
		
		
		
		
			
		
		/// <summary>
        /// 对象实体绑定数据
		///生成构造为list的构造器
        /// </summary>
        private VwProductEntity ReaderBind(IDataReader dataReader,int seq)
        {
            ITOMMS.Entity.VwProductEntity entity = new ITOMMS.Entity.VwProductEntity();
			entity.SEQNO = seq;
            object obj;
						 obj=dataReader["ID"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.ID= (int)obj;
			}
			 entity.产品名称= dataReader["产品名称"].ToString();
			 entity.编号= dataReader["编号"].ToString();
			 obj=dataReader["供应商"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.供应商= (int)obj;
			}
			 entity.公司名称= dataReader["公司名称"].ToString();
			 entity.品牌= dataReader["品牌"].ToString();
			 entity.类别= dataReader["类别"].ToString();
			 entity.型号= dataReader["型号"].ToString();
			 entity.单位= dataReader["单位"].ToString();
			 entity.规格= dataReader["规格"].ToString();
			 entity.采购价= dataReader["采购价"].ToString();
			 entity.批发价= dataReader["批发价"].ToString();
			 entity.零售价= dataReader["零售价"].ToString();
			 obj=dataReader["最低警戒线"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.最低警戒线= (int)obj;
			}
			 obj=dataReader["最高警戒线"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.最高警戒线= (int)obj;
			}
			 entity.备注= dataReader["备注"].ToString();
			 obj=dataReader["是否包含税"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.是否包含税= (bool)obj;
			}
			 obj=dataReader["数量"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.数量= (int)obj;
			}
			 obj=dataReader["CreateDate"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.CreateDate= (DateTime)obj;
			}
			 obj=dataReader["CreateBy"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.CreateBy= (int)obj;
			}
			 obj=dataReader["ModifyDate"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.ModifyDate= (DateTime)obj;
			}
			 obj=dataReader["ModifyBy"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.ModifyBy= (int)obj;
			}

            return entity;
        }
		
		
				/// <summary>
        /// 对象实体绑定数据
		///生成构造为list的构造器
        /// </summary>
        private VwProductEntity ReaderBind(IDataReader dataReader)
        {
            ITOMMS.Entity.VwProductEntity entity = new ITOMMS.Entity.VwProductEntity();
			object obj;
						 obj=dataReader["ID"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.ID= (int)obj;
			}
			 entity.产品名称= dataReader["产品名称"].ToString();
			 entity.编号= dataReader["编号"].ToString();
			 obj=dataReader["供应商"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.供应商= (int)obj;
			}
			 entity.公司名称= dataReader["公司名称"].ToString();
			 entity.品牌= dataReader["品牌"].ToString();
			 entity.类别= dataReader["类别"].ToString();
			 entity.型号= dataReader["型号"].ToString();
			 entity.单位= dataReader["单位"].ToString();
			 entity.规格= dataReader["规格"].ToString();
			 entity.采购价= dataReader["采购价"].ToString();
			 entity.批发价= dataReader["批发价"].ToString();
			 entity.零售价= dataReader["零售价"].ToString();
			 obj=dataReader["最低警戒线"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.最低警戒线= (int)obj;
			}
			 obj=dataReader["最高警戒线"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.最高警戒线= (int)obj;
			}
			 entity.备注= dataReader["备注"].ToString();
			 obj=dataReader["是否包含税"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.是否包含税= (bool)obj;
			}
			 obj=dataReader["数量"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.数量= (int)obj;
			}
			 obj=dataReader["CreateDate"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.CreateDate= (DateTime)obj;
			}
			 obj=dataReader["CreateBy"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.CreateBy= (int)obj;
			}
			 obj=dataReader["ModifyDate"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.ModifyDate= (DateTime)obj;
			}
			 obj=dataReader["ModifyBy"];
			if(obj != null && obj != DBNull.Value)
			{
			 entity.ModifyBy= (int)obj;
			}

            return entity;
        }
		
		
		
		 #endregion
		
	}
}
